
define(["jquery", "easy-admin"], function ($, ea) {


    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'gorder/index',
        add_url: 'gorder/add',
        edit_url: 'gorder/edit',
        delete_url: 'gorder/delete',
        export_url: 'gorder/export',
        modify_url: 'gorder/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: '主键id'},
                    {field: 'order_id', title: '订单编号'},
                    {field: 'delivery_type', title: '送货方式',selectList:{0:'自提',1:'送货上门'}},
                    {field: 'order_status', title: '付款方式',selectList:{0:'待付款',1:'代发货',2:'已发货',3:'已完成',4:'退款中'}},
                    {field: 'create_time', title: '添加时间'},
                    {field: 'location_id', title: '地址id'},
                    {field: 'pay_type', title: '支付方式',selectList:{0:'微信支付',1:'支付宝支付',2:'银联支付'}},
                    {field: 'pay_identity', title: '支付人身份'},
                    {field: 'pay_name', title: '支付人名称'},
                    {field: 'order_remarks', title: '订单备注'},
                    {field: 'goods_price', title: '商品价格'},
                    {field: 'goods_name', title: '商品名称'},
                    {field: 'user__user_name', title: '用户昵称'},
                    {field: 'user__user_username', title: '用户姓名'},
                    {field: 'user__user_phone', title: '用户手机号'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;

});